from django.shortcuts import HttpResponse
from article.models import Article, Tag
from .models import User


def index(request):
    # user = User.objects.create(username='zhiliao', password='zhiliao123')
    # article = Article(title='django', content='python django')
    # article.author = user
    # article.save()

    article = Article.objects.first()
    tag1 = Tag.objects.create(name='python')
    tag2 = Tag.objects.create(name='django')
    article.tags.add(tag1, tag2)
    return HttpResponse('success')
